package com.ydx.meituan.exception;

/**
 * Description:请求处理异常
 */
public class RequestException extends RuntimeException {
    private int code;//错误码
    private Object data;
    public RequestException(int code, String message, Object data) {
        super(message);
        this.code = code;
        this.data=data;
    }
    public RequestException(int code, String message) {
        super(message);
        this.code = code;
    }

    public RequestException(RequestError requestError) {
        super(requestError.getDescription());
        this.code = requestError.getResult();
    }

    public RequestException(RequestError requestError, Object data) {
        super(requestError.getDescription());
        this.code = requestError.getResult();
        this.data=data;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
